<?php
// need move to web-api.php
/*
Route::get('/api/activities/{modelId}/templates', 'Activity\ModelController@templates');
Route::get('/api/activities/models', 'Activity\ModelController@models');
*/
Route::get('/api/activity/lists','Web\ActivityController@');
Route::get('/api/activity/statistics-list', 'Web\Activity\ActivityController@activities');  //新添加 活动统计数据接口
Route::get('/api/activity/dashboard', 'Web\Activity\ActivityController@');  //新添加 数据统计接口

Route::post('copy/{id}', 'Activity\WebApiController@copy');
Route::get('/api/activities/{id}', 'Activity\ManagementController@show');

Route::get('/api/activities/{id}/quizzes', 'Quiz\ApiController@quizzes');
Route::post('/api/activity/quizzes', 'Quiz\ActivityController@store');
Route::post('/api/activities/quizzes', 'Quiz\ActivityController@store');
Route::patch('/api/activities/{id}/quizzes', 'Quiz\ActivityController@update');
Route::get('/api/activities/{id}/quizzes/full-report', 'Quiz\ReportController@full');
Route::post('/api/activities/{activityId}/quizzes/category-report', 'Quiz\ReportController@categoried');
Route::get('/api/activities/{id}/papers', 'Quiz\Paper\ApiController@many');
Route::get('/api/activities/{id}/all-quizzes', 'Quiz\ApiController@byActivity');
Route::get('/api/activities/{id}/quizzes/download-pdf-report', 'Quiz\ReportController@dumpAsPdf');
Route::get('/api/activities/{id}/quizzes/fill-blank', 'Quiz\ReportController@dumpFillBlankAsXlsx');

Route::get('/api/quizzes/not-related', 'Quiz\ActivityController@notRelated');
Route::post('/api/quizzes/{id}/options', 'Quiz\Option\ApiController@store');
Route::post('/api/quizzes/{id}/multiple-options', 'Quiz\Option\ApiController@multipleUpdateOptions');
Route::get('/api/quizzes/{id}/options', 'Quiz\Option\ApiController@many');
Route::post('/api/quizzes', 'Quiz\ApiController@store');
Route::get('/api/quizzes/types', 'Quiz\ApiController@types');
Route::get('/api/quizzes', 'Quiz\ApiController@many');
Route::get('/api/quizzes/{activityId}/unlinked', 'Quiz\ApiController@unlinked');
Route::get('/api/quizzes/{id}', 'Quiz\ApiController@show');
Route::get('/api/options/{id}', 'Quiz\Option\ApiController@show');
Route::patch('/api/quizzes/{id}/sort', 'Quiz\ApiController@sort');
Route::patch('/api/quizzes/{id}', 'Quiz\ApiController@update');
Route::patch('/api/options/{id}', 'Quiz\Option\ApiController@update');
Route::delete('/api/quizzes/{id}', 'Quiz\ApiController@destroy');
Route::delete('/api/options/{id}', 'Quiz\Option\ApiController@destroy');
//Route::get('/api/sheets/filters', 'Quiz\Sheet\ApiController@filter');
Route::get('/api/papers/{id}', 'Quiz\Paper\ApiController@sheets');
Route::delete('/api/papers/{id}', 'Quiz\Paper\ApiController@destroy');

Route::post('/api/activities/shaking', 'Shaking\ActivityController@store');
Route::get('/api/activities/{id}/shaking', 'Shaking\ActivityController@show');
Route::patch('/api/activities/{id}/shaking', 'Shaking\ActivityController@update');
Route::delete('/api/shaking/{activityId}/prizes/{id}', 'Activity\PrizeBindController@unbindPrize');
Route::patch('/api/shaking/{activityId}/prizes/{id}', 'Activity\PrizeBindController@updateBoundPrize');
Route::post('/api/shaking/{activityId}/prize', 'Activity\PrizeBindController@bindPrize');
Route::get('/api/shaking/{activityId}/prizes', 'Activity\PrizeBindController@getBoundPrizes');
# Route::post('/api/shaking/{activityId}/prizes', 'Shaking\WebApiController@batchBindPrizes');

Route::post('/api/activities/roulette', 'Roulette\ActivityController@store');
Route::get('/api/activities/{id}/roulette', 'Roulette\ActivityController@show');
Route::patch('/api/activities/{id}/roulette', 'Roulette\ActivityController@update');
Route::delete('/api/roulette/{activityId}/prizes/{id}', 'Activity\PrizeBindController@unbindPrize');
Route::patch('/api/roulette/{activityId}/prizes/{id}', 'Activity\PrizeBindController@updateBoundPrize');
Route::post('/api/roulette/{activityId}/prize', 'Activity\PrizeBindController@bindPrizeWithAliasName');
Route::get('/api/roulette/{activityId}/prizes', 'Activity\PrizeBindController@getBoundPrizes');
# Route::post('/api/roulette/{activityId}/prizes', 'Roulette\WebApiController@batchBindPrizes');

Route::post('/api/activities/scratch', 'Scratch\ActivityController@store');
Route::get('/api/activities/{id}/scratch', 'Scratch\ActivityController@show');
Route::patch('/api/activities/{id}/scratch', 'Scratch\ActivityController@update');
Route::delete('/api/scratch/{activityId}/prizes/{id}', 'Activity\PrizeBindController@unbindPrize');
Route::patch('/api/scratch/{activityId}/prizes/{id}', 'Activity\PrizeBindController@updateBoundPrize');
Route::post('/api/scratch/{activityId}/prize', 'Activity\PrizeBindController@bindPrize');
Route::get('/api/scratch/{activityId}/prizes', 'Activity\PrizeBindController@getBoundPrizes');
# Route::post('/api/scratch/{activityId}/prizes', 'Scratch\WebApiController@batchBindPrizes');

Route::post('/api/activities/golden-eggs', 'GoldenEggs\ActivityController@store');
Route::get('/api/activities/{id}/golden-eggs', 'GoldenEggs\ActivityController@show');
Route::patch('/api/activities/{id}/golden-eggs', 'GoldenEggs\ActivityController@update');
Route::delete('/api/golden-eggs/{activityId}/prizes/{id}', 'Activity\PrizeBindController@unbindPrize');
Route::patch('/api/golden-eggs/{activityId}/prizes/{id}', 'Activity\PrizeBindController@updateBoundPrize');
Route::post('/api/golden-eggs/{activityId}/prize', 'Activity\PrizeBindController@bindPrize');
Route::get('/api/golden-eggs/{activityId}/prizes', 'Activity\PrizeBindController@getBoundPrizes');
# Route::post('/api/golden-eggs/{activityId}/prizes', 'GoldenEggs\WebApiController@batchBindPrizes');

Route::get('/api/prizes/available', 'Prize\WebApiController@available');
Route::post('/api/prize/import-voucher-code', 'Prize\WebApiController@importVoucherCode');

Route::post('/api/configurations/wechat', 'Configuration\Wechat\WebApiController@set');
Route::get('/api/configurations/wechat', 'Configuration\Wechat\WebApiController@getAuthorizationWechat');
Route::patch('/api/configurations/wechat', 'Configuration\Wechat\WebApiController@set');

/*
Route::post('/api/publishing/wechat/account', 'Publishing\Wechat\WebApiController@setAccount');
Route::get('/api/publishing/wechat/accounts', 'Publishing\Wechat\WebApiController@accounts');
Route::get('/api/publishing/{activityId}/published/wechat', 'Publishing\ApiController@getPublishedAccount');
*/

Route::post('/api/publishing/{activityId}', 'Publishing\WebApiController@publish');
Route::get('/api/publishing/{activityId}', 'Publishing\WebApiController@getPublished');

Route::get('/api/activities/{activities}/wechat-url', 'Activity\PublishingApiController@getWechatPublishingUrl');
Route::get('/api/activities/{activities}/app-url', 'Activity\PublishingApiController@getAppPublishingUrl');

Route::get('/api/votes/export-record', 'Web\Activity\ActivityController@exportVoteRecords');
Route::get('/api/votes/record', 'Web\Activity\ActivityController@getVoteRecords');

//活动基础通用方法
Route::post('/api/activities/activity-common', 'ActivityCommon\ActivityController@store');
Route::get('/api/activities/{id}/activity-common', 'ActivityCommon\ActivityController@show');
Route::patch('/api/activities/{id}/activity-common', 'ActivityCommon\ActivityController@update');
Route::delete('/api/activity-common/{activityId}/prizes/{id}', 'Activity\PrizeBindController@unbindPrize');
Route::patch('/api/activity-common/{activityId}/prizes/{id}', 'Activity\PrizeBindController@updateBoundPrize');
Route::post('/api/activity-common/{activityId}/prize', 'Activity\PrizeBindController@bindPrizeWithAliasName');
Route::get('/api/activity-common/{activityId}/prizes', 'Activity\PrizeBindController@getBoundPrizes');

//猜口令
Route::post('/api/activities/guess-code','GuessCode\ActivityController@store');//猜口令活动添加
Route::get('/api/activity/{id}/guess-code','GuessCode\ActivityController@show');
Route::patch('/api/activities/{id}/guess-code', 'GuessCode\ActivityController@update');
Route::delete('/api/guess-code/{activityId}/prizes/{id}', 'Activity\PrizeBindController@unbindPrize');
Route::patch('/api/guess-code/{activityId}/prizes/{id}', 'Activity\PrizeBindController@updateBoundPrize');
Route::post('/api/guess-code/{activityId}/prize', 'Activity\PrizeBindController@bindPrizeWithAliasName');
Route::get('/api/guess-code/{activityId}/prizes', 'Activity\PrizeBindController@getBoundPrizes');

//微信各商户支付证书上传
Route::post('/api/test/upload/','Activity\WechatController@loadWechatKeyPath');
Route::post('/api/test/send-redpack/','Activity\WechatController@loadWechatKeyPath');